package Day08;

public class Test02 {
    public static void main(String[] args) {
        /*int sum1 = 0;//计算和
        for (int i = 1; i <100; i+=2) {
                sum1+=i;
        }
        System.out.println(sum1);*/
        int sum2=1;//2的0次方
        for (int i = 1; i <= 8; i++) {
            //内循环计算2的i次方
            int ret = 2;//2的1次方
            for (int j = 1; j <i; j++) {
                ret =ret*2; // ret = ret *  2;
            }
            sum2 =sum2+ ret; // sum = sum + ret;
        }
        System.out.println(sum2);
        }
    }
